<?php

// No direct access
defined('_JEXEC') or die;

/**
 * Content component helper.
 *
 * @package		Joomla.Administrator
 * @subpackage	com_content
 * @since		1.6
 */
class AdmissaoHelper
{
	public static $extension = 'com_admissao';

	public static function addSubmenu($vName)
	{
		JSubMenuHelper::addEntry(
			JText::_('COM_ADMISSAO_SUBMENU_ADMISSOES'),
			'index.php?option=com_admissao&view=admissoes',
			$vName == 'admissoes'
		);
		
		$document = JFactory::getDocument();
		$document->addStyleDeclaration('
			.icon-48-admissao { background-image: url(../media/com_admissao/images/icon-48-admissao.png);}
			.icon-48-admissao-add { background-image: url(../media/com_admissao/images/icon-48-admissao.png);}
		');
	}

	public static function getActions($admissaoId = 0)
	{
		$user	= JFactory::getUser();
		$result	= new JObject;

		if (empty($admissaoId)) {
			$assetName = 'com_admissao';
		}
		else {
			$assetName = 'com_admissao.admissao.'.(int) $admissaoId;
		}

		$actions = array(
			'core.admin', 'core.manage', 'core.create', 'core.edit', 'core.edit.own', 'core.delete'
		);

		foreach ($actions as $action) {
			$result->set($action,	$user->authorise($action, $assetName));
		}

		return $result;
	}

}